/**
 * Created by Administrator on 2017/5/5.
 */
$(function(){
    var signature,nickname,age,height,weight,constellation,acceptIntimateBehavior,factFriend,likeType,purpose;
    var token = localStorage.getItem('youyuLoginToken');
    var userData = localStorage.getItem('youyuUserData');
    var uid = $.parseJSON(userData).uid;
    var inforUrl =LOAD_INFO;
    var curTime = new Date().getTime();
    var packParam ={'uid':uid};
    var userInforimation = {
    token:token,
    time: curTime,
    url:inforUrl,
    param:packParam,
    sign:$.md5('ts='+curTime+'&mn=3&chid=0&version=1.0&token='+token+'&param='+JSON.stringify(packParam)),
    okCallback:function(data){
        if(data.data.acceptIntimateBehavior == 1){
            data.data.acceptIntimateBehavior = "接受"
        }else {
            data.data.acceptIntimateBehavior = "不接受"
        }
        if(data.data.factFriend == 1){
            data.data.factFriend = "接受"
        }else {
            data.data.factFriend = "不接受"
        }
        var html = "";
   var photoWall =data.data.photowall.split(',');
   var photos =$.grep(photoWall, function(n) {return $.trim(n).length > 0;});

        if(photos.length==1){
            html='<li><img src="'+photos+'" alt="" class="photoA"></li>';
            $('#bannerlist').append(html);
        }else {
            for (var n in photos){
                html +=' <li class="swiper-slide"><img src="'+photos[n]+'" alt="" class="photoA"></li>';
            }
            $('#bannerlist').append(html);
        }


        $(".signature").text(data.data.signature ? data.data.signature : "");
        $(".nickname").text(data.data.nickname ? data.data.nickname : "");
        $(".age").text(data.data.age ? data.data.age +'岁' : "");
        $(".height").text(data.data.height ? data.data.height +'cm' : "");
        $(".weight").text(data.data.weight ? data.data.weight+'kg' : "");
        $(".constellation").text(data.data.constellation ? data.data.constellation : "");
        $(".acceptIntimateBehavior").text(data.data.acceptIntimateBehavior ? data.data.acceptIntimateBehavior : "");
        $(".factFriend").text(data.data.factFriend ? data.data.factFriend : "");
        $(".likeType").text(data.data.likeType? data.data.likeType : "");
        $(".purpose").text(data.data.purpose ? data.data.purpose : "");
    },
    errorCallback:function(){
    }
}
YY.post(userInforimation);
/*轮播*/
    var mySwiper = new Swiper('.swiper-container',{
        pagination: '.pagination',
        loop:true,
        autoplay : 3000,
    })
})